using System;

using TrueCode.Core.Aspects;


namespace TrueCode.DependencyManager.Extensions
{
  public static class ContainerExtensions
  {
    public static Container AddDefaultService< TService >( this Container container, [NotNull] TService service )
    {
      container.Services.AddDefault< TService >( service );
      return container;
    }

    public static Container AddServiceFor< TService >( this Container container, SessionAim aim, object service )
    {
      container.Services.Add< TService >( aim, service );
      return container;
    }

    public static Container AddServiceFor< TAim, TService >( this Container container, [NotNull] object service )
    {
      container.Services.Add< TAim, TService >( service );
      return container;
    }

    public static Container AddServiceFor< TAim, TService >( this Container container, [NotNull] object serviceKey,
                                                             [NotNull] object service )
    {
      container.Services.Add< TAim, TService >( serviceKey, service );
      return container;
    }
  }
}